package org.duiduo.api.bean;

import lombok.Getter;
import lombok.Setter;
import org.duiduo.api.valid.ValidationGroups;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 书籍 VO
 *
 * @author liangze
 * @date 2021/9/22 14:30
 */
@Getter
@Setter
public class BookVO extends BaseBeanVO {

    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Delete.class}, message = "书籍ID不存在")
    private Integer id;

    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Insert.class}, message = "请输入名称")
    private String name;

    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Insert.class}, message = "请输入价格")
    private BigDecimal price;

    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Insert.class}, message = "请输入作者")
    private String author;

    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Insert.class}, message = "请选择出版时间")
    private Date createTime;

    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Insert.class}, message = "请上传封面")
    private String cover;

    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Insert.class}, message = "请选择所属用户")
    private String userId;

    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Insert.class}, message = "请输入库存数量")
    private Integer count;
}
